use snafu::Snafu;
use crate::core::blueprint::{build_coffee_tales, build_blog, update_document};
use crate::core::error::ParrotError;

#[derive(Debug, Snafu)]
#[snafu(visibility(pub(crate)))]
pub enum BlueprintError {
    #[snafu(display("Failed to build Coffee Tales for android platform: {source}"))]
    BuildAndroidCoffeeTales {
        source: build_coffee_tales::Error,
    },

    #[snafu(display("Failed to build blog: {source}"))]
    BuildBlog {
        source: build_blog::Error,
    },

    #[snafu(display("Failed to update document: {source}"))]
    UpdateDocument {
        source: update_document::Error,
    },
}

impl From<BlueprintError> for ParrotError {
    fn from(value: BlueprintError) -> Self {
        ParrotError::Blueprint { source: value }
    }
}
